apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: gateway-secret-invalid-reference-grant
  namespace: gateway-conformance-infra
spec:
  gatewayClassName: "{GATEWAY_CLASS_NAME}"
  listeners:
    - name: https
      port: 443
      protocol: HTTPS
      allowedRoutes:
        namespaces:
          from: All
      tls:
        certificateRefs:
          - group: ""
            kind: Secret
            name: certificate
            namespace: gateway-conformance-web-backend
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: reference-grant-wrong-namespace
  namespace: gateway-conformance-app-backend
spec:
  from:
    - group: gateway.networking.k8s.io
      kind: Gateway
      namespace: gateway-conformance-infra
  to:
    - group: ""
      kind: Secret
      name: certificate
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: reference-grant-wrong-from-group
  namespace: gateway-conformance-web-backend
spec:
  from:
    - group: not-the-group-youre-looking-for
      kind: Gateway
      namespace: gateway-conformance-infra
  to:
    - group: ""
      kind: Secret
      name: certificate
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: reference-grant-wrong-from-kind
  namespace: gateway-conformance-web-backend
spec:
  from:
    - group: gateway.networking.k8s.io
      kind: HTTPRoute
      namespace: gateway-conformance-infra
  to:
    - group: ""
      kind: Secret
      name: certificate
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: reference-grant-wrong-from-namespace
  namespace: gateway-conformance-web-backend
spec:
  from:
    - group: gateway.networking.k8s.io
      kind: Gateway
      namespace: not-the-namespace-youre-looking-for
  to:
    - group: ""
      kind: Secret
      name: certificate
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: reference-grant-wrong-to-group
  namespace: gateway-conformance-web-backend
spec:
  from:
    - group: gateway.networking.k8s.io
      kind: Gateway
      namespace: gateway-conformance-infra
  to:
    - group: not-the-group-youre-looking-for
      kind: Secret
      name: not-the-certificate-youre-looking-for
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: reference-grant-wrong-to-kind
  namespace: gateway-conformance-web-backend
spec:
  from:
    - group: gateway.networking.k8s.io
      kind: Gateway
      namespace: gateway-conformance-infra
  to:
    - group: ""
      kind: Service
      name: certificate
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: reference-grant-wrong-to-name
  namespace: gateway-conformance-web-backend
spec:
  from:
    - group: gateway.networking.k8s.io
      kind: Gateway
      namespace: gateway-conformance-infra
  to:
    - group: ""
      kind: Secret
      name: not-the-certificate-youre-looking-for
